Page({
  data: {

  },
  onLoad: function (options) {
    this.setData({
      id: options.id
    }, () => {
      wx.util.request('order.detail', {
        query: `id=${this.data.id}&simplify=1`
      }).then(res => {
        this.setData({
          status: res.pay_status
        });
      }).catch(err => {
        console.log(err);
      });
    });
  },
  go: function (e) {
    let page = e.currentTarget.dataset.page
    if (page == 'order') {
      wx.redirectTo({
        url: `../order/detail?id=${this.data.id}`
      });
    } else {
      wx.switchTab({
        url: "../index/index"
      });
    }
  }
})